home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 22 / AACD 22.iso / AACD / Programming / RxMUI / Examples / popa.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  2001-05-24  |  3.1 KB  |  120 lines

  1. /**/
  2.  
  3. signal on halt
  4. signal on break_c
  5.  
  6. l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then exit
  7. if AddLibrary("rxmui.library")~=0 then exit
  8.  
  9. call RxMUIOpt("debugmode showerr")
  10. call CreateApp
  11. call HandleApp
  12. /* never reached */
  13. /***********************************************************************/
  14. HandleApp: procedure
  15.  
  16.     ctrl_c=2**12
  17.     do forever
  18.         call NewHandle("app","h",ctrl_c)
  19.         if and(h.signals,ctrl_c)>0 then exit
  20.         select
  21.             when h.event="QUIT" then exit
  22.             otherwise interpret h.event
  23.         end
  24.     end
  25.     /* never reached */
  26. /***********************************************************************/
  27. err: procedure expose sigl rxmuierror
  28. parse arg res
  29. say sigl "["res"]"
  30.     say getrxmuistring(res) "in line" sigl-1 rxmuierror
  31.     exit
  32. /***********************************************************************/
  33. CreateApp: procedure
  34.  
  35.     app.Title="PopaslExample"
  36.     app.Version="$VER: PopaslExample 1.0 (12.10.2000)"
  37.     app.Copyright="©2000, alfie"
  38.     app.Author="alfie"
  39.     app.Description="PopaslExample"
  40.     app.Base="RXMUIEXAMPLE"
  41.     app.SubWindow="win"
  42.      win.ID="MAIN"
  43.      win.Title="PopaslExample"
  44.      win.Contents="MGROUP"
  45.  
  46.       mgroup.0="pg"
  47.        pg.class="group"
  48.        pg.frame="group"
  49.        pg.frametitle="Popasl example"
  50.        pg.background="groupback"
  51.        pg.Columns=2
  52.  
  53.       pg.0=label("HTML only")
  54.       pg.1="popf"
  55.        popf.class="popasl"
  56.        popf.FilterMacro="parse arg a,b,c;return match('#?.(htm|html)',a)"
  57.        popf.DomultiSelect=1
  58.        popf.AcceptPattern="#?"
  59.        popf.RejectPattern="#?.o"
  60.         url.Maxlen=16000
  61.        popf.String=string("file")
  62.        popf.DoPattern=1
  63.        popf.SleepWindow=1
  64.        popf.InitialPattern="#?"
  65.        popf.Title="File selector"
  66.       pg.2=label("Above")
  67.       pg.3=Text("info")
  68.  
  69.       pg.4=label("Drawer")
  70.       pg.5="popd"
  71.        popd.class="popasl"
  72.        popd.String=string("dir")
  73.        popd.DrawersOnly=1
  74.        popd.Title="Drawer selector"
  75.  
  76.       pg.6=label("Font")
  77.       pg.7="popfo"
  78.        popfo.class="popasl"
  79.        popfo.type="font"
  80.        popfo.String=string("font")
  81.        popfo.Title="Fonts selector"
  82.        popfo.toggle=0
  83.  
  84.       pg.8=label("Fixed font")
  85.       pg.9="popfof"
  86.        popfof.class="popasl"
  87.        popfof.type="font"
  88.        popfof.FixedWidthOnly=1
  89.        popfof.String=string("fixedfont")
  90.        popfof.Title="Fonts selector"
  91.  
  92.       mgroup.1="bg"
  93.        bg.class="group"
  94.        bg.horiz=1
  95.         bg.0=hspace()
  96.         bg.1=button("fo","Font _Open")
  97.         bg.2=hspace()
  98.  
  99.     res=NewObj("APPLICATION","APP")
  100.     if res~=0 then call err(res)
  101.  
  102.     call set("win","open",1)
  103.     call getattr("win","open","o")
  104.     if o=0 then do
  105.         say "can't open window"
  106.         exit
  107.     end
  108.  
  109.     call Notify("win","CloseRequest",1,"app","ReturnID","quit")
  110.     call notify("file","newcontents","everytime",info,set,contents,triggervalue)
  111.  
  112.     call notify("fo","pressed",0,"popfo","open")
  113.  
  114.     return
  115. /***********************************************************************/
  116. halt:
  117. break_c:
  118.     exit
  119. /**************************************************************************/
  120.